package de.koller.nature.proto;

import de.koller.oceanFramework.gl.util.ImagePreview;
import java.awt.image.BufferedImage;
import java.util.Random;

public class HillLandscape {

	public static void main( String[] args ) {
		Random rnd = new Random();
		
		final int w = 1200;
		final int cs = 10;
		final int maxV = 3;
				
		int[] t = new int[ w ];
		int[] th = new int[ w + cs*2 ];
		
		for( int i = 0; i < th.length; i++ )
			th[i] = rnd.nextInt( maxV+1 );
		
		for( int x = 0; x < t.length; x++ )
			for( int i = -cs; i < cs; i++ )
				t[x] += th[x+cs+i];
		
		BufferedImage img = new BufferedImage( t.length, cs*2*maxV, BufferedImage.TYPE_INT_ARGB );
		for( int x = 0; x < t.length; x++ )
			for( int y = 0; y < cs*2*maxV; y++ )
				if( y > img.getHeight() - t[x] )
					img.setRGB( x, y, 0xff000000 );
				else
					img.setRGB( x, y, 0xffffffff );
		
		ImagePreview.showImage( img, img.getWidth(), img.getHeight() );
		
	}
	
}
